package cn.com.template.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import cn.com.support.context.UserContext;

@Controller
public class Login {
	
	
	@RequestMapping("/login")
	public ModelAndView login(HttpServletRequest request) {
		ModelAndView mav = new ModelAndView("login");
		if (request.getParameter("failure")!=null){
			mav.addObject("failure", "true");
		}else{
			mav.addObject("failure", "false");
		}
		return mav;
	}
	
	@RequestMapping("/logout")
	public ModelAndView logout() {
		return new ModelAndView("login");
	}

}
